﻿<div ng-controller="ManagerPackController">
    <div class="row">
        <div class="col-lg-12 col-sm-12 col-xs-12">
            <div class="well with-header">
                <div class="header bg-blue">Manage Pack 
                <span class="btn btn-sm pull-right" ng-click="popup('modal-message modal-info','FormAddPackModal','lg')"><i class="fa fa-plus-circle"></i> Buy Pack</span>
                </div>
                <div class="body">
                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12" ng-repeat="item in overview">
                            <div class="databox radius-bordered databox-shadowed databox-graded">
                                <div class="databox-left databox-icon bg-azure">
                                    <i class="fa fa-bar-chart-o"></i>
                                </div>
                                <div class="databox-right bg-white bordered bordered-platinum">
                                    <span class="databox-number orange">{{item.Total|number:8}}</span>
                                    <div class="databox-text darkgray text-uppercase">{{item.Name}}</div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-12 col-sm-12 col-xs-12">
                            <div class="well with-header">
                                <div class="header bg-blue">Running</div>
                                <div class="body"> 
                                    <table class="table table-bordered table-striped table-condensed flip-content">
                                        <thead class="flip-content">
                                            <tr>                                                
                                                <th width="15%">Name</th>
                                                <th>Amount</th>
                                                <th width="10%">Create Date</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr ng-repeat="item in runings" ng-if="runings.length != 0">                                                
                                                <td>
                                                    <a href="#app/packdetail/{{item.Id}}">{{item.Title}}</a>
                                                </td>
                                                <td>
                                                    <i class="fa fa-bitcoin"></i>{{item.Amount|number:8}}
                                                    <!--<a href="#app/packdetail/{{item.Id}}">
                                                        <progressbar class="progress-striped" value="item.Percent<=100?item.Percent:100" style="margin-bottom:0"></progressbar>
                                                    </a>-->
                                                </td>
                                                <td>
                                                    {{item.CreateDate}}
                                                </td>
                                            </tr>
                                            <tr ng-if="runings.length == 0">
                                                <td colspan="3">Not Data</td>                                                
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--Success Modal Templates-->
    <script type="text/ng-template" id="WarningModal">
        <div class="modal-header">
            <i class="glyphicon glyphicon-check"></i>
        </div>
        <div class="modal-title">{{title}}</div>
        <div class="modal-body">
            {{ messeger }}
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-success" ng-click="ok()">OK</button>
            <button type="button" class="btn btn-default" ng-click="cancel()">Cancel</button>
        </div>
    </script>
    <script type="text/ng-template" id="FormAddPackModal">
        <div class="modal-header">
            <h4>Buy Pack</h4>
        </div>        
        <div class="modal-body">    
            <div class="loginbox">
                <alert type="{{AlertType}}" class="radius-bordered alert-shadowed" ng-if="messeger">
                    {{messeger}}
                </alert>
                <form name="simpleForm" method="post" class="bv-form" novalidate="novalidate">
                    <div class="form-group">
                        <ui-select ng-model="wallet.selected">
                            <ui-select-match placeholder="Select or search a wallet in the list...">
                                {{$select.selected.Name}}
                            </ui-select-match>
                            <ui-select-choices repeat="item in WalletList | filter: $select.search">
                                <span ng-bind="item.Name"></span>
                            </ui-select-choices>
                        </ui-select>
                        {{data.Wallet=wallet.selected.Id;""}}
                    </div>                    
                    <div class="form-group">
                        <input class="form-control" ng-model="data.Amount|number:8"  placeholder="Amount" type="text" readonly>
                    </div>
                </form>
            </div>
        </div>
        <div class="modal-footer">
            <span ng-show="processing" class="text-success"><i class="fa fa-circle-o-notch fa-spin"></i></span>
            <button type="button" class="btn btn-success" ng-click="doAddPack(data)" ng-disabled="progress">Add Pack</button>
            <button type="button" class="btn btn-default" ng-click="cancel()">Cancel</button>
        </div>
    </script>
    <!--End Success Modal Templates-->
</div>
